(function($, window) {
	var userCodeApi = window.userCodeApi = {};
	var baseRequest = window.baseRequest;
	var appConfig = window.appConfig;
	var commonTool = window.commonTool;
	var dataManager = window.dataManager;
	
	//add by dongjuanying
	var getPhoneCodeUrl = appConfig.userApiPortalUrl + '/getPhoneCode';
	userCodeApi.getPhoneCode = function(phoneNum,callback){
		baseRequest.digestPost(getPhoneCodeUrl, {phone:phoneNum}, 5000, function (code, data) {
            if (code === 2 || code === 1) {
                return callback(2);
            }
            if (data.code === 0) {
                callback(0);
            } else {
                callback(1,data.message);
            }
        });
	}
	
	var checkPhoneCodeUrl = appConfig.userApiPortalUrl + '/checkPhoneCode';
	userCodeApi.checkPhoneCode = function(phoneNum,codeValue,callback){
		baseRequest.digestPost(checkPhoneCodeUrl,
			{
				phone: phoneNum,
				checkCode: codeValue
			}, 5000, function (code, data) {
	            if (code === 2 || code === 1) {
	                return callback(2);
	            }
	            if (data.code === 0) {
	                callback(0);
	            } else {
	                callback(1);
	            }
	        });
	}
	//end

	//add by zhangfuqiang
	
	//end

	//add by ding

	//end

	//add by wangyu

	//end

	//add by wuchengcheng

	//end

})(mui, window);